package cn.sczc.jh.client.entity;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

@TableName("t_permission")
public class Permission {

	/**
	 * 用于角色管理--编辑--回显(默认选中)
	 */
	@TableField(exist = false)
	private static Map<String, Object> state = new HashMap<String, Object>();
	static {
		state.put("checked", false);
	}

	@TableId(value = "id_")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;
	@TableField(value = "name_")
	private String name;
	@TableField(value = "code_")
	private String code;
	@TableField(value = "pid_")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long pid;
	@TableField(value = "group_")
	private Integer group;
	@TableField(value = "create_time")
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	@TableField(value = "create_by")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long createBy;
	@TableField(value = "update_time")
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
	@TableField(value = "update_by")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long updateBy;
	@TableField(exist = false)
	private List<Permission> nodes;
	@TableField(exist = false)
	private String text;
	

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}
	

	public Integer getGroup() {
		return group;
	}

	public void setGroup(Integer group) {
		this.group = group;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Long getCreateBy() {
		return createBy;
	}

	public void setCreateBy(Long createBy) {
		this.createBy = createBy;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Long getUpdateBy() {
		return updateBy;
	}

	public void setUpdateBy(Long updateBy) {
		this.updateBy = updateBy;
	}

	public List<Permission> getNodes() {
		return nodes;
	}

	public void setNodes(List<Permission> nodes) {
		this.nodes = nodes;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public Map<String, Object> getState() {
		return state;
	}

	public static void setState(Map<String, Object> state) {
		Permission.state = state;
	}
	
	

}
